package com.landian.sell.controller;

import com.landian.sell.service.DataService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author caojl
 */
@RestController
@RequestMapping("/api")
public class ApiController {

    @Autowired
    private DataService dataService;

    @GetMapping("/seller")
    public String seller(@ApiParam(required = false) @RequestParam(defaultValue = "") String id) {
        return dataService.sellerInfo(id).toString();
    }

    @GetMapping("/goods")
    public String goods() {
        return dataService.goodsInfo().toString();
    }
}
